try:
    # from part1 import Part, PART_DIR, GROUP_DIR,Global_Cache
    from group_new import *
except:
    # from .part1 import Part, PART_DIR, GROUP_DIR,Global_Cache
    from .group import *

class Transform():
    def __init__(self, clamp,unit_name):
        self.clamp = clamp
        self.unit_name = unit_name
    def to_shape(self):
        clamp_shape = Body(self.clamp.group_type)
        # print(clamp_shape.args)
        # clamp_shape.args = copy.deepcopy(self.clamp.args)
        # # def update_parameter(clamp):
        # #     for arg in clamp.args:
        # #         first_index = arg.find('__')
        # #         element_name = arg[:first_index]
        # #         element_arg = arg[first_index + 2:]
        # #         element = clamp.elements[element_name]['instance']
        # #         element.args[element_arg]['v'] = clamp.args[arg]['v']
        # #     return clamp
        # # clamp_shape=update_parameter(self.clamp)
        # clamp_shape.elements = copy.deepcopy(self.clamp.elements)
        clamp_shape.transform = copy.deepcopy(self.clamp.transform)

        return clamp_shape